package com.study.controller.PSIcontroller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.study.model.mdao.PSImdao.WarehouseAndGoodsMapper;

@RestController
@Controller
public class WarehouseTabController {
	@Autowired
	WarehouseAndGoodsMapper wg;
	
	/**
	 * @param warehid
	 * @return
	 * 查询所有的仓库
	 */
	@RequestMapping("/wHouseTabAll")
	@ResponseBody
	private String findAllwg(){
		return JSON.toJSONString(wg.findAllwHouse());
	}
	/**
	 * @param warehid
	 * @return
	 * 根据仓库id查询所有仓库里面的商品
	 */
	@RequestMapping("/wagByid")
	@ResponseBody
	private String findbyWaid(int warehid){
		return JSON.toJSONString(wg.findAllwgByid(warehid));
	}
	
}